package CACA;


public class Rule {
	ItemSet itemSet;
	int label;
	int suppCount;
	double conf;
	public Rule(ItemSet itemSet,int label)
	{
		this.itemSet = itemSet;
		this.label = label;
	}
	public void calculateConf()
	{
		conf = (double)suppCount/(double)itemSet.suppCount;
	}
	public double getConf()
	{
		return conf;
	}


	public int getSuppCount() {
		return suppCount;
	}
	public String toString()
	{
		String str = " ";
		for (Item item : itemSet.items) {
			str += " ("+String.valueOf(item.attribute)+"-"
		+String.valueOf(item.value)+") ";
		}
		str += "-> ";
		str += String.valueOf(label) ;
		return str;
	}
	public Item getItemAt(int i)
	{
		return itemSet.get(i);
	}
	public int countItemSet()
	{
		return itemSet.items.size();
	}
	public int getLabel() {
		// TODO Auto-generated method stub
		return label;
	}
	
}
